<!DOCTYPE html>
<html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@include file = "/shmged/jsp/com/shlcm/portal/main/head.jsp" %>
<%@ page import="shmged.com.shlcm.utils.*"%>
<%@ page import="wt.inf.container.WTContainer"%>
<%@ page import="wt.inf.container.WTContainerRef"%>
<%@ page import="wt.folder.Folder" %>
<%@ page import="wt.folder.FolderHelper" %>
<%@page import="wt.httpgw.URLFactory"%>
<head>
</head>
<%

String contName = CmSettings.getSection("DefaultLocation").get("SHMGEDContainerName");

%>


<body>
<center>
	<div><jsp:include page="createProjectSchedule.jsp"></jsp:include></div>
	<div style="margin:10px 0;"></div>
	<div class="easyui-layout" style="width:720px;height:750px;">
		<div data-options="region:'center',title:'项目信息',iconCls:''"> 
			<div style="padding:5px;">
			<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add'" onclick="browseCreateProjectSchedule()">创建项目进度</a>
			</div>
	      <table id="<%=uuid %>ttProjectSchedule"></table>
		</div>
	</div>
</center>
<script>
		//初始化table
		initProjectScheduleTable("/Default/项目管理/项目信息");
		function initProjectScheduleTable(folderName){
			var url='<%=baseUrl%>shmged/jsp/com/shlcm/documents/jspSearchDocument.jsp';
			  $('#'+'<%=uuid %>ttProjectSchedule').datagrid({   
			      url:url,
			      queryParams:{folderName:folderName,info:"项目进度"},
			      nowrap:false,
			      loadMsg:'正在加载数据，请稍等。。。',
				  fitColumns: true,
			      columns:[[   
					  {field:'id',title:'id',width:100,checkbox:true},  
			          {field:'name',title:'项目名',width:60,
			        	  //添加超级链 
	                     formatter:function(value,rowData,rowIndex){
							if(rowData.number!=""){
	                    		 return "<a href='javaScript:void(0)' onclick=\"javaScript:addProjectScheduleTab('','','"+rowData.id+"','"+rowData.name+"')\">"+rowData.name+"</a>";  
							}

			          }
				          },
			          {field:'modifyUser',title:'创建者',width:60},
			          {field:'time',title:'创建时间',width:120}    
			      ]] 
			    }); 
		}



		function addProjectScheduleTab(tabObj,tabId,oid,name){
			var defaultTabId = "cmTabs";
			if(tabId){
				defaultTabId = tabId;
			}
			var tabDefault = {
				href:"<%=baseUrl %>shmged/jsp/com/shlcm/projects/viewProjectSchedule.jsp?oid="+oid,
				title:name+"进度",
				selected: true,
				closable:true
			};
			var options ;
			if(tabObj){
			    var empty = {};
				options = $.extend(empty,tabDefault,tabObj);
			}else{
				options = tabDefault;
			}
			if($('#'+defaultTabId).tabs("exists",options.title)){
				$('#'+defaultTabId).tabs('select',options.title);
			}else{
			    $('#'+defaultTabId).tabs('add',options);
			}

		}
	</script>
</body>
</html>